#pragma once
#include"Sence.h"
#include"Sence_Manager.h"
#include"Animation.h"
extern Atlas peashooter_run_right;
extern SenceManager sence_manager;
extern 	Camera _camera;
class GameSence :public Sence
{
public:
	void on_enter()
	{
		animation.set_atlas(&peashooter_run_right);
		animation.set_frame_space(75);
		animation.set_is_loop(true);
	}
	void  on_update(int interval)
	{
		_camera.on_update(interval);
		animation.on_update(interval);
	}
	void  on_input(ExMessage& msg)
	{
		if (msg.message == WM_KEYDOWN)
		{
			sence_manager.switch_to(SenceManager::Sence_Type::MENU);
		}
	}
	void  on_draw()
	{
		const vector2& pos_camera = _camera.get_postion();
		animation.draw(100 - pos_camera._x, 100 - pos_camera._y);
	}
	void  on_exit()
	{
		cout << "Gamesence_on_enter" << endl;
	}

private:
	Animation animation;
};
